package com.test.personalblogproject.controller;

import com.test.personalblogproject.pojo.FavoritesCollection;
import com.test.personalblogproject.pojo.Result;
import com.test.personalblogproject.service.FavoritesCollectionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/favoritesCollection")
@Api(tags="收藏列表表")

public class FavoritesCollectionController {
    @Autowired
    private FavoritesCollectionService favoritesCollectionService;

    @ApiOperation("增加新的收藏列表")
    @PostMapping("createList")
    public Result createList(@RequestParam("name")String name,@RequestParam("privateOrNot") int privateOrNot){
        return favoritesCollectionService.createNewList(name,privateOrNot);

    }

    @ApiOperation("查看所有的收藏列表")
    @PostMapping("viewAllCollection")
    public Result viewAllCollection(){
        return favoritesCollectionService.viewAllCollection();

    }

}
